<?php
namespace app\api\model;
use app\common\model\News as NewsModel;
use think\Db;

class News extends NewsModel
{
    public function getList($type_id=0)
    {
        if ($type_id==0){

            $type_id=DB::name('news_type')->where('state',1)->value('id');

        }

        return $this->where('type_id',$type_id)->select();

    }
}